package o;

import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.CheckResult;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.upstream.DataSpec;
import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;

public interface ail {

    public static final class a {
        public final long ʽ;
        public final long ˊ;
        public final long ˋ;
        public final DataSpec ˎ;
        public final Map<String, List<String>> ˏ;
        public final Uri ॱ;

        public a(DataSpec dataSpec, Uri uri, Map<String, List<String>> map, long j, long j2, long j3) {
            this.ˎ = dataSpec;
            this.ॱ = uri;
            this.ˏ = map;
            this.ˊ = j;
            this.ˋ = j2;
            this.ʽ = j3;
        }
    }

    public static final class c {
        private final CopyOnWriteArrayList<b> ˊ;
        @Nullable
        public final o.aim.a ˋ;
        private final long ˎ;
        public final int ˏ;

        static final class b {
            public final Handler ˋ;
            public final ail ॱ;

            public b(Handler handler, ail o_ail) {
                this.ˋ = handler;
                this.ॱ = o_ail;
            }
        }

        public c() {
            this(new CopyOnWriteArrayList(), 0, null, 0);
        }

        private c(CopyOnWriteArrayList<b> copyOnWriteArrayList, int i, @Nullable o.aim.a aVar, long j) {
            this.ˊ = copyOnWriteArrayList;
            this.ˏ = i;
            this.ˋ = aVar;
            this.ˎ = j;
        }

        @CheckResult
        public c ˊ(int i, @Nullable o.aim.a aVar, long j) {
            return new c(this.ˊ, i, aVar, j);
        }

        public void ˏ(Handler handler, ail o_ail) {
            boolean z = (handler == null || o_ail == null) ? false : true;
            amm.ˊ(z);
            this.ˊ.add(new b(handler, o_ail));
        }

        public void ॱ(ail o_ail) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                if (bVar.ॱ == o_ail) {
                    this.ˊ.remove(bVar);
                }
            }
        }

        public void ॱ() {
            o.aim.a aVar = (o.aim.a) amm.ॱ(this.ˋ);
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new aik(this, bVar.ॱ, aVar));
            }
        }

        private /* synthetic */ void ˊ(ail o_ail, o.aim.a aVar) {
            o_ail.ˊ(this.ˏ, aVar);
        }

        public void ˏ() {
            o.aim.a aVar = (o.aim.a) amm.ॱ(this.ˋ);
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new aio(this, bVar.ॱ, aVar));
            }
        }

        private /* synthetic */ void ॱ(ail o_ail, o.aim.a aVar) {
            o_ail.ˏ(this.ˏ, aVar);
        }

        public void ˎ(DataSpec dataSpec, int i, int i2, @Nullable Format format, int i3, @Nullable Object obj, long j, long j2, long j3) {
            ˏ(new a(dataSpec, dataSpec.ˎ, Collections.emptyMap(), j3, 0, 0), new e(i, i2, format, i3, obj, ˊ(j), ˊ(j2)));
        }

        public void ˏ(a aVar, e eVar) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new ain(this, bVar.ॱ, aVar, eVar));
            }
        }

        private /* synthetic */ void ˊ(ail o_ail, a aVar, e eVar) {
            o_ail.ˏ(this.ˏ, this.ˋ, aVar, eVar);
        }

        public void ॱ(DataSpec dataSpec, Uri uri, Map<String, List<String>> map, int i, int i2, @Nullable Format format, int i3, @Nullable Object obj, long j, long j2, long j3, long j4, long j5) {
            ˋ(new a(dataSpec, uri, map, j3, j4, j5), new e(i, i2, format, i3, obj, ˊ(j), ˊ(j2)));
        }

        public void ˋ(a aVar, e eVar) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new air(this, bVar.ॱ, aVar, eVar));
            }
        }

        private /* synthetic */ void ˋ(ail o_ail, a aVar, e eVar) {
            o_ail.ˎ(this.ˏ, this.ˋ, aVar, eVar);
        }

        public void ˏ(DataSpec dataSpec, Uri uri, Map<String, List<String>> map, int i, int i2, @Nullable Format format, int i3, @Nullable Object obj, long j, long j2, long j3, long j4, long j5) {
            ˊ(new a(dataSpec, uri, map, j3, j4, j5), new e(i, i2, format, i3, obj, ˊ(j), ˊ(j2)));
        }

        public void ˊ(a aVar, e eVar) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new aip(this, bVar.ॱ, aVar, eVar));
            }
        }

        private /* synthetic */ void ˎ(ail o_ail, a aVar, e eVar) {
            o_ail.ॱ(this.ˏ, this.ˋ, aVar, eVar);
        }

        public void ˎ(DataSpec dataSpec, Uri uri, Map<String, List<String>> map, int i, long j, long j2, long j3, IOException iOException, boolean z) {
            ˋ(dataSpec, uri, map, i, -1, null, 0, null, -9223372036854775807L, -9223372036854775807L, j, j2, j3, iOException, z);
        }

        public void ˋ(DataSpec dataSpec, Uri uri, Map<String, List<String>> map, int i, int i2, @Nullable Format format, int i3, @Nullable Object obj, long j, long j2, long j3, long j4, long j5, IOException iOException, boolean z) {
            ˏ(new a(dataSpec, uri, map, j3, j4, j5), new e(i, i2, format, i3, obj, ˊ(j), ˊ(j2)), iOException, z);
        }

        public void ˏ(a aVar, e eVar, IOException iOException, boolean z) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new ait(this, bVar.ॱ, aVar, eVar, iOException, z));
            }
        }

        private /* synthetic */ void ॱ(ail o_ail, a aVar, e eVar, IOException iOException, boolean z) {
            o_ail.ˊ(this.ˏ, this.ˋ, aVar, eVar, iOException, z);
        }

        public void ˎ() {
            o.aim.a aVar = (o.aim.a) amm.ॱ(this.ˋ);
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new ais(this, bVar.ॱ, aVar));
            }
        }

        private /* synthetic */ void ˏ(ail o_ail, o.aim.a aVar) {
            o_ail.ˎ(this.ˏ, aVar);
        }

        public void ॱ(int i, @Nullable Format format, int i2, @Nullable Object obj, long j) {
            ॱ(new e(1, i, format, i2, obj, ˊ(j), -9223372036854775807L));
        }

        public void ॱ(e eVar) {
            Iterator it = this.ˊ.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                ˊ(bVar.ˋ, new aiq(this, bVar.ॱ, eVar));
            }
        }

        private /* synthetic */ void ˊ(ail o_ail, e eVar) {
            o_ail.ˊ(this.ˏ, this.ˋ, eVar);
        }

        private long ˊ(long j) {
            long ˋ = C.ˋ(j);
            if (ˋ == -9223372036854775807L) {
                return -9223372036854775807L;
            }
            return this.ˎ + ˋ;
        }

        private void ˊ(Handler handler, Runnable runnable) {
            if (handler.getLooper() == Looper.myLooper()) {
                runnable.run();
            } else {
                handler.post(runnable);
            }
        }
    }

    public static final class e {
        public final long ʼ;
        public final long ʽ;
        @Nullable
        public final Format ˊ;
        public final int ˋ;
        public final int ˎ;
        @Nullable
        public final Object ˏ;
        public final int ॱ;

        public e(int i, int i2, @Nullable Format format, int i3, @Nullable Object obj, long j, long j2) {
            this.ˋ = i;
            this.ॱ = i2;
            this.ˊ = format;
            this.ˎ = i3;
            this.ˏ = obj;
            this.ʼ = j;
            this.ʽ = j2;
        }
    }

    void ˊ(int i, o.aim.a aVar);

    void ˊ(int i, @Nullable o.aim.a aVar, a aVar2, e eVar, IOException iOException, boolean z);

    void ˊ(int i, @Nullable o.aim.a aVar, e eVar);

    void ˎ(int i, o.aim.a aVar);

    void ˎ(int i, @Nullable o.aim.a aVar, a aVar2, e eVar);

    void ˏ(int i, o.aim.a aVar);

    void ˏ(int i, @Nullable o.aim.a aVar, a aVar2, e eVar);

    void ॱ(int i, @Nullable o.aim.a aVar, a aVar2, e eVar);
}
